package com.linq.cool.beauty.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.linq.cool.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @Author: yqlin
 * @Date: 2021/2/1 03:59
 * @Description: 车辆
 * @Version: 1.0.0
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "beauty_vehicle")
public class BeautyVehicle extends BaseEntity {
    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 客户id
     */
    @NotNull(message = "客户编号不能为空")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "member_id")
    private Long memberId;

    /**
     * 品牌(sys_dict_item的 id 对应code:beauty_vehicle_brand)
     */
    @NotNull(message = "品牌不能为空")
    @TableField(value = "brand")
    private Integer brand;

    /**
     * 车牌号(如京Q01234)
     */
    @NotBlank(message = "车牌号不能为空")
    @TableField(value = "license_number")
    private String licenseNumber;

    /**
     * 型号
     */
    @NotBlank(message = "型号不能为空")
    @TableField(value = "model")
    private String model;

    /**
     * 汽车图片
     */
    @NotBlank(message = "汽车图片不能为空")
    @TableField(value = "pic")
    private String pic;

    /**
     * color
     */
    @NotBlank(message = "颜色不能为空")
    @TableField(value = "color")
    private String color;

    /**
     * 车架编号
     */
    @NotBlank(message = "车架编号不能为空")
    @TableField(value = "frame_no")
    private String frameNo;

    /**
     * 发动机号
     */
    @NotBlank(message = "发动机号不能为空")
    @TableField(value = "engine_no")
    private String engineNo;

    /**
     * 年检时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(value = "inspection_time")
    private Date inspectionTime;

    /**
     * 保险开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(value = "insurance_start_time")
    private Date insuranceStartTime;

    /**
     * 保险到期时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(value = "insurance_end_time")
    private Date insuranceEndTime;
    /**
     * 逻辑删除
     */
    @TableLogic
    @TableField(value = "is_deleted")
    private Integer isDeleted;
}